﻿<dd>
    <table width="725" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="416" class="td01">尊敬的，<font>{$name}</font> 您好！<span>(普通会员)</span></td>
        <!-- <td width="44">余额：</td>
        <td width="122"><span>0.000元</span></td>
        <td width="56" align="right">可用：</td>
        <td width="87"><span>0.000元</span></td> -->
      </tr>
      <tr>
        <td>还没有上传头像？ 点击<a href="#">
        <form action="/Home/Personcenter/upload.html" enctype="multipart/form-data" method="post" id="form">
            <input type="file" name="photo"/>
            <button class="return_del" style="width:95px;height:30px;background-color: #b70100;color:#fff;font-size: 15px;font-weight: bolder;box-shadow: 5px 5px 5px lightgray;cursor: pointer;">更换头像</button>
        </form>
        <!-- </a><a class="save" href="#">保存</a></td> -->
        <!-- <td>冻结：</td>
        <td><span>0.000元</span></td>
        <td align="right">已提现：</td>
        <td><span>0.000元</span></td> -->
      </tr>
    </table>
    <img src="/ThinkPHP/ThinkPHP/{$time}/{$photo}" style="width: 130px;height:150px;" id="headimg" />
</dd>
<script type="text/javascript">
    $(function(){
        $('#form').on('submit',function(){
            $.ajax({
                url: $(this).attr('action'),
                type: 'post',
                dataType: 'json',
                data: $(this).serialize(),
                success:function(img){
                    if (img.code=="200") {
                        $('#headimg').attr('src',img.src);
                    }else{
                        $('#headimg').attr('alt',img.src);
                        $('#headimg').attr('title',img.src);
                    }
                }

            });
        });
    });
</script>